/**
 * @date 10:52:37 AM
 * SubjectLessonController.java
 * Administrator
 * TODO
 */
package com.qs.education.controllers;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.entity.EducationQuestion;
import com.qs.education.bean.entity.EducationSubjectLesson;
import com.qs.education.service.ISubjectLessonAPIService;

/**
 * @class SubjectLessonController
 * @author Warren
 * @description
 * @date Nov 20, 2018
 */
@RestController
public class SubjectLessonController {

	@Autowired
	private ISubjectLessonAPIService iSubjectLessonAPIService;

	@RequestMapping("subjectLesson/getALLAPI")
	public ResponseListBean<EducationSubjectLesson> getALL() {
		ResponseListBean<EducationSubjectLesson> responseListBean = iSubjectLessonAPIService.getALL();
		return responseListBean;
	}

	/**
	 * @Description 根据课时选择 题目以及数量
	 * @author Leon
	 * @date Nov 20, 2018
	 * @param
	 * @return ResponseListBean<EducationSubjectLesson>
	 */
	@RequestMapping("subjectLesson/selectTopicAndNumber")
	public ResponseListBean<EducationSubjectLesson> selectTopicAndNumber(
			@RequestParam(value = "lessonIds") List<String> lessonIds) {
		ResponseListBean<EducationSubjectLesson> lessonList = new ResponseListBean<EducationSubjectLesson>();
		lessonList = iSubjectLessonAPIService.selectTopicAndNumber(lessonIds);
		return lessonList;
	}

	/**
	 * @Description 根据选择的课时 题目数量 场景 以及 题目难度进行 智能组题
	 * @author Leon
	 * @date Nov 21, 2018
	 * @param params：[ {lessonId:1,number:2}, {lessonId:2,number:3} ] scenes: 场景
	 *        level ： 等级
	 * @return ResponseListBean<EducationQuestion>
	 */
	@RequestMapping("subjectLesson/getQuestionListByLesson")
	public ResponseListBean<EducationQuestion> getQuestionListByLesson(String params, String scenes, String level) {
		ResponseListBean<EducationQuestion> questionList = new ResponseListBean<EducationQuestion>();
		questionList = iSubjectLessonAPIService.getQuestionListByLesson(params, scenes, level);
		return questionList;
	}
}
